added some code and documentation