Merging igraham branch with bfox's