refactored and added spec (but it fails)
Merge pull request #1 from audy/add-tests

refactored and added spec (but it fails)