Moved into function

Edited ruby example to call main function
Added in README blurb about using functions
Added thanks in readme