A verified upgrade of the GHEISHA simulation of particle interactions