first 2 tasks from Code Tuning and Optimization