you may move this function to pyramid element class. suggestion.