some more speedups and TTW changes