I added some descriptions to undertand how works every function