added q-expansions computnig code that works in general