added some dcumentation to contract demo
slight refactor, added io module