Modified per Nathan and Blaine.