 					neededVerticesCount = 0;
 					for (localVertexId = 0; localVertexId < 3; ++localVertexId)
 					{
-						inIndices.position = (usedIndicesCount + localVertexId) << 2;
-						oldVertexIds[localVertexId]	= inIndices.readUnsignedShort();
+						oldVertexIds[localVertexId]	= inIndices[uint(totalUsedIndices + usedIndicesCount + localVertexId)];
 						
 						var tmp : Object = usedVerticesDic[oldVertexIds[localVertexId]];
 						

	 */
	public final class GeometrySanitizer
	{
		public static const INDEX_LIMIT		: uint = 524270;
		public static const VERTEX_LIMIT	: uint = 65535;
		
		public static function isValid(indexData		: ByteArray,
									   vertexData		: ByteArray,

					// it fills, let insert the triangle
					for (localVertexId = 0; localVertexId < 3; ++localVertexId)
					{
						if (newVertexNeeded[localVertexId])
						{
							// copy current vertex into the new array
