first attempt for 2 pass digest