removed unused variable warnings.
minor fix.
changed test case data.
fixes and refactoring.
removed debugging output.
added test function; improved postcondition checking.
bugfix; new test function,
new util functions added.