fixed a small derp in square function