changed variable name
added free memory macro
macro cleanup