add buildElement function