tidying up file ends