add method and struct