Combined the mapSnake function and the globalSnake function, also deleted some redundant things