quick speedup by checking first val