Can you briefly explain what this method does? Meaning what each line does?