Added functions to predict next word in sequence