Fix up the pseudo code a bit