working version of two kinds of zklock