removing "stupid"  useless code
improving grid alloc free