solver function

Common argument