Pls note that:
PARAMETETER variables have a scope equivalent to a PRIVATE variable
Variables within parenthesis eg: Main(param), have a scope equivalent to a LOCAL variable
So the PARAMETER sentence must be locate AFTER all local definitions.