a little bit of optimization, every milisecond counts