Installer script -- function not found error

I am writing an installation script on AIX. This involves typical checks of some pre requisites like java, oracle, some version checks, disk space etc. It is a long script. I am facing a strange problem. There are a no of functions used in the script. What I see is that the installer complains of some function not found. When I am rearranging them, some of the errors go away and some others come up. I am ensuring that a function is called after it is written. There are about 25 functions and some calls from within functions also. I am able to understand at which line the errors orogonate, but not why. I find too difficult to manage the installer of about 1300 lines. Is there anyway to manage/ debug errors here? So far I could not make any clue with the errors. Can someone throw some light?
Thanks
AC

Try Bourne Shell echo flag:
$sh -x script