added structure to code for modular work on surveys