Use better data structures in gmx chi