calculates quads