Introducing automated testing

Create a test to expose the bug
More comprehensive tests