support for motion detect

added bitwiseAnd function