updated rspec tests and added some comments