added compare function, working make and makefile (thanks to A-Copz)