added testing and documentation