Added comments, corrected indentation.