introduce evaluate function, add pretty print