shrink psudo code