added testing and validation