Code for Results in Ph.D Dissertation "Aligned Hierarchies for Sequential Data"