Avoid Math.pow for squaring