Updated logic for ticket fare calculation