Updated solving procedure