Changed the parameter in the handle_rejected_step to a reference otherwise there are a lot of unneccessary copies.