using nodeRadius instead of a constant integer
Also added brackets for to reduce ambiguous else statements.