I modified it to what you suggested, but I don't see why it really matters as val does not use the input in this case.