Feature/calc memory fix