public void loadFileBMSFormat(String filepath, int maxCount, int minSize, int maxSize) throws IOException {
		String thisLine;
		BufferedReader myInput = null;
		try {
			FileInputStream fin = new FileInputStream(new File(filepath));
			myInput = new BufferedReader(new InputStreamReader(fin));
			int lastId = 0;
			
			int count = 0;
			Sequence sequence = null; //current sequence
			while ((thisLine = myInput.readLine()) != null  && count < maxCount) { //until end of file
				
				String[] split = thisLine.split(" ");
				int id = Integer.parseInt(split[0]);
				int val = Integer.parseInt(split[1]);
				
				if(lastId != id){ //if new sequence
					if(lastId !=0 && sequence.size() >= minSize && sequence.size() <= maxSize ){  //adding last sequence to sequences list
						sequences.add(sequence);
						count++;
					}
					sequence = new Sequence(id); //creating new sequence with current id
					lastId = id;
				}
				Item item = new Item(val); //adding current val to current sequence
				sequence.addItem(item);
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (myInput != null) {
				myInput.close();
			}
		}
		
	}