cleaning code, adding evaluate function