Merged some Scott L. Burson code from https://github.com/slburson/weblocks