Updated main function to support hisotry function.
makefile added to the rebo.