added some unit tests to check that the functions seem to be doing what they are supposed to