refactored so square inherits from rectangle