All code commented and refactorized