rewrite snake.js
hack hack hack