Trying to make a simple snake game using HTML5 canvas and javascript