added implementation for iteration 9