optimized memset of heap array a little and removed some commented code