added function to collect data over months