updated algorithms