Formatted code, updated comments.