Here my solution to this question, but i not really sure what is wrong with the output