Made solver more robust by adding a random factor