Final commit

Functions are implemented.  Test code added to validate different
scenarios.