Modified new_keys to act like a queue.