better algorithm for flowers