Algorithm fixed TODO: test