Implemented new key code system