add functions for solve