used Robert's fundtion to update word representation