first tests and real code. Implemented new structure