basic scheme with working locks