mutable ints solution does not work for the backward pass