Finished all the functions