I know my solution works, but I would like to know if the function can be simplified so that the loop is not called twice. Is there a way to pass the properties to be run th