functions for selecting a box was designed