more test cases added. All passing. Ready for merging.