I'm having a little trouble with these two particles. . .

я нервничаю и думаю, что же купить.
Он нервничает и думает, что бы купить.

The sentences were translated as

I am nervous and think...