Made calcIndex work with negative values.
getAdjList is now working.