Speed Improvement

Speed improvement of about 10% by skipping some variable initializaiton,
changing from mutex to critical section, etc.