Some tidying and commenting