logic updated to pass new rspec tests, comments left in