Adding Techcraft code from http://techcraft.codeplex.com/(#19900c922855)