Changes to code as per feedback 3.0
More tests as suggested in feedback.