added timeDiff function