Is there a way that I could make a better comparison for the first and last if? For instance, if I wanted a different behavior for float
first
last
float