Rspec fun

Added spec tests and removed some old code