Removed mem dependency. Up to user to figure this out.