Solution algorithm changed