Function getNonDeletedElements