Do you have a tester of some sort? You can determine which black is the run back to the panel and which is dead going forth to another outlet. Changing black wires w/o knowing what they do is of no use. The back of the first plug has in and out or line and load. A white and a black should occupy each side with the hot coming in on the gold screw and the white on the silver. Same for the load side.
Now, with your circuit partially assembled, you can switch your breaker on and carefully check the 2nd outlet wires to see if black is hot. You should be able to check any black wire to any ground, ground wire or white wire. You should also check white wires to ground just in case. If you don't have at least a little tester like this neon one, you should get one:
A safer tester is a non contact one but it won't tell you all the neon one will. Sometimes wires are just too close.
Above all, BE CAREFUL! Get the non contact tester anyway and poke it at all wires. If it chirps and lights up, you have power and you can get hurt.
Even with the breaker off because other circuits may be present or might be back feeding wires you want to work on. I have this situation ongoing at a job.