Create modulo and time difference