when i insert delete temp right before the function ends, my program crashes. Without that extra line, the program works fine but lags after some time.
Thanks a lot! One more thing though, my program slows down a bit after about 15 seconds of running, aside from memory leaks, are there any possible reason why the program slows down??