Cleaning up and commenting code.