fix erroneous reference to .match function and added some comments to hopefully make optional/required more easily understood