displayElements() method