public List<List<Gate>> getGates() {
		List<List<Gate>> layersOfGates = new ArrayList<List<Gate>>();
		boolean firstLine = true;

		try {
			BufferedReader fbr = new BufferedReader(new InputStreamReader(
					new FileInputStream(circuitFile), Charset.defaultCharset()));
			String line;
			//hack to skip first line
			List<Gate> currentLayer = null;
			while ((line = fbr.readLine()) != null) {
				if (line.isEmpty()){
				} else if (firstLine) {
					headerLine = line;
					String[] split = headerLine.split(" ");
					numberOfInputs = Integer.parseInt(split[0]);
					numberOfInputs = Integer.parseInt(split[1]);
					numberOfWires = Integer.parseInt(split[2]);
					numberOfANDGates = Integer.parseInt(split[5]);


					firstLine = false;
				} else if (line.startsWith("*")) {
					currentLayer = new ArrayList<Gate>();
					layersOfGates.add(currentLayer);
				} else {
					// Parse each gate line and count numberOfNonXORGates
					Gate g = new Gate(line, InputGateType.CUDA);
					currentLayer.add(g);
				}
			}
			fbr.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

		return layersOfGates;
	}