adding documentation and code