p1207: improvement on speed