Got the ruby code all working