added 'var' in original_val definition