updated the function so it is....functional.