partial lock counter implementation
added sdiff filter function