add speed up code