Adding more testing and debugging