added memory cleanup. changed blocksize to 16px