Broken for loop in mousepressed;