mmfunctions: add free_space function

also add tests for output file and integer within free_space function
Added free_space function and fixed variables/functions names