added handling of QMARK and BANG functions