Add prinln snippet and fix func