update from Tal's UFO3 branch