Adding comments and refactorising