Updated documentation

Added tests, haven't fixed conflicts with last commit