Implemented a method to evaluate vars at a given index