adds documentation and minor changes