updated to use range inputs.