main file rework