added collision detection for the wall and the snakes own body