Refactored into a more functional style, added comments
added some more specs
remove curb gem