shared variable solution