Wrote a method to get elements