Slow algorithm. Slows when items > 20.