Some changes to the sketch for timing

Still working out the optimal PWM generator