implemenation of class structure