implemented first part of game engine