update solution algorithm