Created tests and fixed game engine