This is the IDEA and working version of the previous gridsnake.