Homologous and analogous organs
take the example of dinosaurs and birds , dinosaurs had feathers for insulation. however feathers in birds are used for flying. it might have been possible that the feathers in birds at initial stage was for insulation and later they were adopted for flying. this shows that birds and reptiles are closely related .