modify to correct the backward distance