Implemented memory clean