small changes to the Key code