removed one execute usage and replaced getVarIdx with rvar