Added qaqcchk function, tested