Adding ben's code and debugging