added contract and documentation