added glossaries and introduced global states + minor