Final version completed with a few rspec tests