Finished the function.
Clean up functions.