modify equilibrium to correct codility errors