Defined a more elegant way to find the first value