added snake direction variable