got the main evaluate function to work