This is code I have written in Ruby