Adding getElement function