prototyping the getElements function