added output and rspec test