added parsing of parameter count