organise and comment code