public boolean checkMotions(int newPix[] ,int oldPix[] ,int width ,int height,
								int x0 ,int y0 ,byte data[] ,boolean bNotShifted ) {
		int pos;
		int nrMotions=0;
		boolean areMotions = false;
		final byte red   = (byte)Color.green.getRed();
		final byte green = (byte)Color.green.getGreen();
		final byte blue  = (byte)Color.green.getBlue();
		
		if (bNotShifted) {
			for (int y=0; y<height; y++) {
				for (int x=0; x<width; x++) {
					/* if the pixels difference is great than 20 has been a motion */
					if (Math.abs(newPix[y*width +x] - oldPix[y*width +x]) > 20) {
						nrMotions++;
						pos = (240 - (y + y0))*960 + (x + x0)*3;
						if ((pos >= 0) && (pos+2 < data.length )) {
							data[pos] = blue;
							pos++;
							data[pos] = green;
							pos++;
							data[pos] = red;
						}
					}	
				}
			}
		}
		
		if (nrMotions >= 25) {
			if (bNotShifted) {	
				areMotions=true;
			} else {
				areMotions=false;
			}
		}
		return areMotions;
	}