removed excess code and fixed grid glitch