An enhanced routing algorithm for internet of things that resolves heterogeneity issues