re-wrote first two sections