minor modifications to add element