edited data update code to account for time stamps