Finish writing all the functions