Porting started from plain C project
more code added