finished the function.