Calculation of moments of inertia and gyromagnetic ratios including residual p-h and p-p interaction