Basic implementation with several assumptions.

See readme for implementation notes.