added memory utilities and corrected previous merge error