working on mem
comment mem related code