solution for final exercises 6