Learned that 4+18 doesn't make 20ms and cleaned a bit the code.