Improved code style and logic
Fixed errors and logic
Added rspec and basic Slot, SlotRange tests