if statements created checking to make sure the user input all information required to run  function properly.