Added evaluation function, and put the old main function into its own me...

...thod.