Neater way of determining result