Further condensed code to enable fast editing

I removed many unnecessary extra for-loops and grouped the objects with their text. I am now going to look at formatting the text within the boxes :)