definition of basic classes with main functions. (to be reviewed)