Add printing code to reduce repetitive steps