New autoBin function.