Adding comments and some reformatting.