the code from my ruby mod