Class structure

the class structure should be something similar to the codes here