fix duality gap calculation