added conditional to guess origin column