clean and add step by step comments