Fixed code errors.
Timing bug still a problem