added simple C byte array locking