Cleaned up function ordering and comments.