Replaced order.first with minimum