added next word prediction; added testcase