commit 4: add self collision detection for snake