Scientists solve mystery of when flowers originated