optimize speed for x[y]