Reverted to working model, using while-loop
Fixed memory error in wave functions file
Memory fixes
More plots
Misc