started work on solve()