add code and restructure