Added more of my code + the code from the answers of the lecturer