finished but did not test the first three functions.