Added timer and logging functinality.