finished code to write time window summaries of heart rate by activity