Fixed the thing about the number of alternations.
Fixed data structures a little bit.