added vars and funcs to snake.js