Simplifys data structure, fixes label bug, adds label attributes.