Changes to example and algorithm