minor changes and reordering