simplified with the same functionality after learning about vmc callbacks