update assign algorithm