parts 2 & 3 Code