Designing better algorithms: 5 case studies