optimised the code a little, removed a bunch of redundant lines.

there is a new error when editing purchases i have to trouble shoot that. besides that there is a noticable speed gain in the code now.