rearranged some notes, comments and other minor editing