Time diff function changed