Combine distance/degrees functions
Fixed merge conflict.