Resolving issue #140 - adding the code directly from the jsfiddle site.