add method circleIndexOf to Array and function smoothing