Paola's code updated