What's the point of this code? In what cases is elem an object?