refactored most of anne's comments