Finished the 3rd function.