update code to utiilze user variable