Added guard and rspec and some tests