Two algorithms to choose now.