Updated all algorithms to modify object rather than return new object.