A rectangle has length twice the side of a square and width three units less than the side of the square. If the two areas are equal what are the dimensions of the square?