Added comments and reformatting.