Changed LAST to AVERAGE for consolidation function. (Thanks to OG)