Might have fixed the seg fault with a hack in boundary conditions.