Change type of dt to float + improve reduction.