added rspec and tests