Added better documentation of functions, test suite failing (?)