Lock code implementation