fleshed out documentation and specification, added example program