snake crawling rightly

corrected the code to make the snake crawl