Scientists find why humans evolved to have curly hair