changed order: comparison - calculation