Begin PI_DIC main codes