Solve function works now. Now on to formating the output