Finished staff duration analysis function.