redefined free_n as a macro to get rid of warning messages