added design and implementation document and fixed typo in grammar-ideal