trying to make logic more dynamic through variables