tidying up the main file