Need to change the way the algorithm sets the inputs