revised impl of time_until_slot
rudimentary impl of build_packet()