Simplified code using level-mem