MST parser code, speed up