Bug with alreadyVisitedMethods corrected.