added some comments; simple reformatting