put solution finding into a separate function to make testing easyer
do not write the equations in terms of lists