Add documentation and finish implementation