modest performance improvments, now only 1.2-1.3 x slower than before