minor fixes and teneja distance