Algorithm works without error.