tidying up my code on blocks