REmoved some unnecessary recursive calls