Ported from earlier phototagger