pseudo code fix