cleaning and commenting code