implement models

-just first version(a lot of work need to be done to final version)