merging in working code and stuff