Code cleanup
Timing calculations added