adding testing func and validating parameters