binary pattern scan