Move function body out of header file + debug