Successfully calculating metrics for all states…but they are out of order