corrected bad code and added name property to each box