clean up and commenting code