SOO MUCH WORK: refactoring + create_file debug