Add beginning byte scanning logic