Difference-of-Squares: Updated to use functions