 		octree->jobCount = 0;
 	}
 	
-	if (octree->animation != NULL)
-	{
-		free(octree->animation);
-		octree->animation = NULL;
-		octree->frameCount = octree->boneCount = 0;
-	}
 	if (octree->d_animation != NULL)
 	{
 		cudaFree(octree->d_animation);
 		octree->d_animation = NULL;
 		octree->frameCount = octree->boneCount = 0;
 	}
+
 	if (octree->currentFrame != NULL)
 	{
 		free(octree->currentFrame);

		cudaFree(octree->d_innerNodes);
		octree->d_innerNodes = NULL;
	}
	if (octree->d_leaves != NULL)
	{
		cudaFree(octree->d_leaves);


	if (result.d_animation == NULL)
	{
		cudaMalloc( ( void ** ) &( result.d_animation ), result.frameCount * result.boneCount * sizeof( Matrix ) );	
		cudaMemcpy( result.d_animation, & animation[ 0 ], result.frameCount * result.boneCount * sizeof( Matrix ), cudaMemcpyHostToDevice );
	}

	return result;
