Added simple memory wrapper code.