Changed existing code to fit criteria of box assignment.