moved functions to solver package