almost certain this is a correct implementation of route stripping