make binary scan length configurable at runtime