added ability to find offset by itself
autodetect offset