what about testing all the time `res[0]` rather than testing its len?