compilation seems to work

todo: bit of code cleaning
todo: support all file formats