solved show n chars function