file structure improved, compilation automated with cmake