function out=psibc(psiin,NN,N)
%makes the stream function of dimension NN (y) and N(x) satisify the BC's



out=psiin; 
out(1:N,1)=zeros(N,1); out(N*(NN-1)+1:NN*N,1)=zeros(N,1); %edges require no flow through boundary
out(N+1:2*N,1)=.8*out(2*N+1:3*N,1)-.2*out(3*N+1:4*N,1); %zero vorticity on edges fixes the value one grid away
out((NN-2)*N+1:(NN-1)*N,1)=.8*out((NN-3)*N+1:(NN-2)*N,1)-.2*out((NN-4)*N+1:(NN-3)*N,1);