fixed some stupid mistakes.  should work now, but problem with nproc > nbasis still exists