A functionalist approach to the acquisition of grammar