Added note explaining why recursion was used