Adding documentation and fixing broken test