Add tests and best bins selector functions