add function: findElements in Helper.java