added doc comments to all functions -- to be finished