query optimisation was implemented. Memory leak was fixed. Verbose cosmetic