Cleaned up clique code