integrating refactored code -- still needs testing and additional text editing