I think it's cool to use `lockedState.indexOf` to make code more clean and easier to understand.