array calculation rectified and HSL in process