restruct, +makefile

merged from test