Error checking: make sure that there are 3 parameters and that the