functions for qexps