improves snake.js