added check for arguments and whether or not they are required