Pasted code and added my own comment