avoid reading the whole array