fixed a majority of the bugs for a simple case. Only problem right now is the savefile function.