calculate adjacent nodes implemented and some typing errors repaired