first part of integration