added doc functions, and commentary