changed box index's to variabels