modified the timing part of the code to use Timer.h