Updated difference-of-squares to use sum