implemented functions to update word prediction

fixes #108