handle_retain function

Handle retain columns