Updated evaluation function