second part output revised