The person at the end of a queue should actually be served first, according to new research