Code polish, adding documentation.