Improved parsing, added X case