Np. There's certainly a better way to script this, but it's simple enough that it doesn't need an elegant solution.