multiple keys pseudo code