change algorithm of creating nested subtrips in trip model