functions completed. Reasonably documented.