Logical clock algorithms