spruning the main file