re-wrote qb from scratch