tidy up the code slightly
update the changelog