design functions and struct