third task from Code Tuning and Optimization