repace square with rect