Added object recycling to minimize GC. Fixed some bugs