                     if (diff > minLapTime*1000 || (shouldSkipFirstLap && newLapIndex == 0)) { // if minLapTime haven't passed since last lap, then it's probably false alarm
                         digitalLow(led);
                         if (newLapIndex < MAX_LAPS-1) { // log time only if there are slots available
-                            lapTimes[newLapIndex] = diff;
+                            if (raceType == 1) {
+                                // for the raceType 1 count time spent for each lap
+                                lapTimes[newLapIndex] = diff;
+                            } else {
+                                // for the raceType 2 count times relative to the race start (ever-growing with each new lap within the race)
+                                uint32_t diffStart = now - raceStartTime;
+                                if (timeCalibrationConst) {
+                                    diffStart = diffStart + (int32_t)diffStart/timeCalibrationConst;
+                                }
+                                lapTimes[newLapIndex] = diffStart;
+                            }
                             newLapIndex++;
                             lastLapsNotSent++;
                             addToSendQueue(SEND_LAST_LAPTIMES);

    remove already existing items from queue
*/

#define API_VERSION 2 // version number to be increased with each API change (int16)

// #define DEBUG


    } else {
        switch (controlByte) {
            case CONTROL_START_RACE: // start race
                raceStartTime = millis();
                lastMilliseconds = raceStartTime;
                DEBUG_CODE(
                    digitalHigh(serialTimerPin);
                );
                newLapIndex = 0;
                isRaceStarted = 1;
                raceType = 1;
                allowEdgeGeneration = 0;
                playStartRaceTones();
                addToSendQueue(SEND_RACE_STATE);
                isConfigured = 1;
                break;
            case CONTROL_START_RACE_ABS: // start race with absolute laps timing
                raceStartTime = millis();
                lastMilliseconds = raceStartTime;
                newLapIndex = 0;
                isRaceStarted = 1;
                raceType = 2;
                allowEdgeGeneration = 0;
                playStartRaceTones();
                addToSendQueue(SEND_RACE_STATE);
