Cleaning and commenting code