typo
it is not simple
could be used in pure ruby also
update the doc
doc the main function