Added comments. Fixed style errors.