ENH: fixed solve function