Implemented loop for div creation, function for span creation, fixed width/overflow issues