Fixed huge memory leak, but made it lag like a bitch