19. finish checking KKT conditions