Updated to change from two input parameters to one input list as parameter.