changed the to a class to handle a set of boxes