Square code and rspec test added