E1S6: simplified keyloc code