fixed up sample so it prints grouped by dates