fixing and tidying up