updated snake.js