new version of sum now produces same result as old