lookup input vars using hash instead, quicker and more reliable