https://devhubby.com/thread/how-to-get-a-variable-out-of-a-procedure-in-the