added 2 sections; code reorganization