initial version of topNdist