from sitepoint article
github source is beautifulcoder