code started out from Jack McKew's blogpost, but very few parts of that original is left
click to hide all page contents: hide