solution for part 3, printf has been cleaned