tidy up ruby example and add comments
add more comments