now handles running out of codes