# Confused about step 5 of official Rubik's 3x3 Cube solution

I can get to this point pretty reliably now, but when I try the method shown I'm just as likely to go from one or no corners to two yellow corners as I am to go back again the next round. I don't mess up the solved rows of the cube; things just seem to shuffle at random at this step. I get the feeling I might not be fully understanding what it means to re-orient the cube.

For example:

State 1:
Y B Y
G O Y B R
R Y Y Y O
Y G Y O Y
R G B

Which produced State 2:
Y O R
O B Y G Y
B Y Y Y R
Y R Y Y O
B G G

Rotated 90° clockwise (to match state 2 as per the guide) and produced State 3:
R O O
G Y Y Y G
B Y Y Y G
O Y Y Y R
B R B


...which coincidentally solves it this time. Guess it sensed my crying out for help.

I guess what it boils down to is I'm not sure what to do when I get two corners up, as I haven't gotten particularly good at predicting where pieces will end up at this stage in the puzzle as of yet. Any advice to be offered on that point?