added some more tests, cleaned up all the documentation so that it passes checks, changes some details of functions to be more accurate