Adding more functionality and rspec tests.