Updating from Martin's previous changes