Volumes with cross sections: squares and rectangles