added snake collision function and game states