added more unit tests. reformatted documentation