added array equilibrium algo