Issue: #4 Marks changes with some minor refactoring to seperate out test cases