algorithm framework