tested and removed bugs in snake