Code reformatting and commenting