fixing math in clique code