moving distance by category to ncdev branch