implemented simple sniff function