cleans up main file