added model updating based on data