public SVG(String fileName) throws FileNotFoundException, SVGFormatException {
		//Before we get started we need to call on the default constructor to initialize our arraylist that will hold all the shapes
		this();//<-- this call will initialize the listOfShapes

		/*At this point, we are ready to read through our input file and start converting the inputs into Shape objects. After we have 
		 * read and converted each line into the respective Shape object, we can add the Shape object into the Array list.
		 */

		//We will utilize the FileReader and BufferedReader to read the file line by line
		FileReader fileReader = new FileReader(fileName); //<--this creates a new file reader that we can use to read the file containing our shape commands
		//If the file is not available for use it will throw the FileNotFoundException

		//We will then utilize the BufferedReader to read from the file in manageable chunks
		BufferedReader bufferedReader = new BufferedReader(fileReader);//<--this creates a new BufferedReader that will read from file as needed

		//We will create a string that will hold each line of the shape command that we read from the input file
		String shapeCommandLine = null;//<--we will set it to null and this will also serve as a loop control

		/*At this point we will need be able to throw a SVGFormatException if there are formatting errors when we are reading form the 
		 * file. So we will enclose this in a try and catch block and if a format error is found we will throw the SVGFormatException.
		 */

		try {
			//We will utilize a while loop to read through until we hit the end of the file. We will be notified of hitting the end of the file when our string is null
			while ((shapeCommandLine = bufferedReader.readLine()) != null) {//<--this while loop will run until the end of the file is reached
				//We will also need to handle if we encounter an empty line, in this case we will need to skip this line and move to the next line
				if (shapeCommandLine.trim().equals(""))//<--this will check if the line is empty
					continue;//<--if so we will go to the next line by going to the top of the while loop

				//We will also need to throw an error if there is a space after the last character in the input file
				//We will use the substring method to get the a substring of the last character 
				if(shapeCommandLine.substring(shapeCommandLine.length() - 1).equals(" ")){//<--this will check if the last character in the string is a space
					throw new SVGFormatException();
				}

				//Once we have our shapeCommandLine, we will convert each string into and put it into an array
				String[] shapeCommandLinecomponent = shapeCommandLine.split(" ");//<--this will split the shapeCommandLine using space as delimiter

				/*Now we will need to parse each array element into the appropriate format
				 * We know that the array[1],[2],[3] will be integers values for our color object
				 * We also know that the array[4] and array[5] will contain double for our OriginX and OriginY
				 */
				int red = Integer.parseInt(shapeCommandLinecomponent[1]);//<--this will read the 1st element and convert it to the red integer
				int green = Integer.parseInt(shapeCommandLinecomponent[2]);//<--this will read the 2nd element and convert it to the green integer
				int blue = Integer.parseInt(shapeCommandLinecomponent[3]);//<--this will read the 3rd element and convert it to the green integer
				double originX = Double.parseDouble(shapeCommandLinecomponent[4]);//<--this will read the 4th element and convert it to the double value for OriginX
				double originY = Double.parseDouble(shapeCommandLinecomponent[5]);//<--this will read the 5th element and convert it to the double value for OriginY
				//We will take the Color values and create a color object ahead of time so that we can easily utilize it when creating our shapeobjects
				Color color = new Color (red, green, blue);

				//We will begin by analyzing if the first component of the command is valid
				switch (shapeCommandLinecomponent[0]) {
				case "square":
					//The sixth component and convert it as the relative size and pass it to the Shape constructor
					double size = Double.parseDouble(shapeCommandLinecomponent[6]); //Read size of the square and convert to double
					if (size < 0) {
						throw new SVGFormatException();
					}
					Shape square = new Square(color, originX, originY, size);
					listOfShapes.add(square); // Add the square to the list
					break;
				case "rectangle":
					//Read the width and height from the text and convert them to double and create the object
					double width = Double.parseDouble(shapeCommandLinecomponent[6]);//Read the width of the rectangle and convert to double
					double height = Double.parseDouble(shapeCommandLinecomponent[7]);//Read the height of the rectangle and convert to double
					if (width < 0) {
						throw new SVGFormatException();
					}
					if (height < 0) {
						throw new SVGFormatException();
					}
					Shape rectangle = new Rectangle(color, originX, originY, width, height);
					listOfShapes.add(rectangle); // Add the rectangle to the list
					break;
				case "ring":
					//Read the outer and inner radiuses, convert them to double and create the Ring object
					double outerRadiusOfRing = Double.parseDouble(shapeCommandLinecomponent[6]);
					double innerRadiusOfRing = Double.parseDouble(shapeCommandLinecomponent[7]);
					if (outerRadiusOfRing < innerRadiusOfRing) {
						throw new SVGFormatException();
					}
					if (outerRadiusOfRing < 0) {
						throw new SVGFormatException();
					}
					if (innerRadiusOfRing < 0) {
						throw new SVGFormatException();
					}
					Shape ring = new Ring(color, originX,originY, outerRadiusOfRing, innerRadiusOfRing);
					listOfShapes.add(ring);//Add the ring to the list
					break;
				case "circle":
					//Read the radius, convert it to double and create the Ring object
					double radius = Double.parseDouble(shapeCommandLinecomponent[6]); //Read size of the square and convert to double
					if (radius < 0) {
						throw new SVGFormatException();
					}
					Shape circle = new Circle(color, originX, originY, radius);
					listOfShapes.add(circle);//Add the circle to the list
					break;
				case "parallelogram":
					double relativeSize = Double.parseDouble(shapeCommandLinecomponent[6]); //Read size of the square and convert to double
					if (relativeSize < 0){
						throw new SVGFormatException();
					}
					Shape parallelogram = new Parallelogram(color, originX, originY, relativeSize);
					listOfShapes.add(parallelogram);//Add the parallelogram to the list
					break;
				case "triangle":
					double relativeHeight = Double.parseDouble(shapeCommandLinecomponent[6]);
					if (relativeHeight < 0){
						throw new SVGFormatException();
					}
					Shape triangle = new Triangle(color, originX, originY, relativeHeight);
					listOfShapes.add(triangle);//Add the triangle to the list
					break;
				case "trapezoid":
					double relativeTrapezoidWidth = Double.parseDouble(shapeCommandLinecomponent[6]);
					double relativeTrapezoidHeight = Double.parseDouble(shapeCommandLinecomponent[7]);
					Shape trapezoid = new Trapezoid(color, originX, originY, relativeTrapezoidWidth, relativeTrapezoidHeight);
					listOfShapes.add(trapezoid);//Add the trapezoid to the list
					break;
				case "semiring":
					double outerRadiusOfSemiRing = Double.parseDouble(shapeCommandLinecomponent[6]);
					double innerRadiusOfSemiRing = Double.parseDouble(shapeCommandLinecomponent[7]);
					int direction = Integer.parseInt(shapeCommandLinecomponent[8]);
					if (outerRadiusOfSemiRing < innerRadiusOfSemiRing) {
						throw new SVGFormatException();
					}
					Shape semiring = new SemiRing(color,originX, originY, outerRadiusOfSemiRing, innerRadiusOfSemiRing, direction);
					listOfShapes.add(semiring);//Add the SemiRing to the list
					break;
				case "semicircle":
					double radiusOfSemiCircle = Double.parseDouble(shapeCommandLinecomponent[6]);
					int directionOfSemiCirlce = Integer.parseInt(shapeCommandLinecomponent[7]);
					Shape semicircle = new SemiCircle(color, originX, originY, radiusOfSemiCircle, directionOfSemiCirlce);
					listOfShapes.add(semicircle);//Add the SemiCircle to the list
					break;
				default:
					// If the first component is unknown then the file is not properly formated
					throw new SVGFormatException();
				}
			}


		} catch (IOException e) {
			System.out.println("Error reading file. So sorry!");
		} 
		catch (NumberFormatException e) {
			throw new SVGFormatException();
		} catch (IllegalArgumentException e) {
			throw new SVGFormatException();
		}
		catch (Exception e) {
			throw new SVGFormatException();
		} finally {
			try {
				fileReader.close();
			} catch (IOException e) {
				System.out.println("IO Exception occured when trying to close File Reader");
				e.printStackTrace();
			}
			try {
				bufferedReader.close();
			} catch (IOException e) {
				System.out.println("IO Exception occured when trying to close Buffered Reader");
				e.printStackTrace();
			}
		}
	}