Add documentation and testing functions