implemented WordNgram class methods; passes all tests