Added code from the lecture