Rewrote the calculations for cpu time as they were totally wrong.