Update function

Update functon for generic entities.