DJ: Improvement to code readability and tidy up.  Back to selfequal this. Tests are passing as expected.  Thanks for the MOtor Team for their feedback.