speedup fixes