change structure to fit func