added update and predict