holy crap this assignment is hard...