Finished setScanElement method