Removed bug in getSuccessor