Factored out readProb and solve methods