changed static structure to dynamic