A cognitive complexity metric applied to cognitive development