fixed state selection problem with long strings + added MIT license clause