added assignment D - CYK recognizer