fixed a bug and timings