minor pseudo code changes