initial build, sets up logic for future merge and reduce