split up steps into separate functions
helps with debugging
fixed nones in average, pivot long to wide