simple padlock implementation