almost finished schrodinger code