Snake Game in javascript