Change the getElements function