more general solver