Processing JSON, computing result, adding another check for timegap.