Recursive call fixed, returns proper values now. Using a HashMap instead of a HashSet to avoid duplicate entries and infinite looping.