combine eliminate and solve functions