CheckParams function

Check if input parameters are valid