Added getSquare function.