Classes and dynamic memory finished(beta version)