reorganizing main file