my implementation of the snake game