tweaked the constants, implemented simpler (3 zc) period matching