Added parameter counting functionality