[UPDATE] add function to free memory from lvals