diff --git a/crp.m b/crp.m
index 9ad81bdc9b49600fc8aba26197e19d74248485b1..3df78e27f41c6495d8603384fbf06ac683237b31 100644
--- a/crp.m
+++ b/crp.m
@@ -84,6 +84,9 @@ function xout=crp(varargin)
 % $Revision$
 %
 % $Log$
+% Revision 5.17  2012/10/22 14:18:33  marwan
+% bug fix: normalisation of data when data contains Inf
+%
 % Revision 5.16  2010/06/29 12:46:47  marwan
 % bug in checking the lengths of x and y
 %
@@ -272,6 +275,9 @@ if isnumeric(varargin{1}) 		% read commandline input
               'Embedding dimension is set to ',num2str(m),'.'])
      end
      action='init';
+     
+  if size(x,1)<size(x,2), x=x'; end
+  if size(y,1)<size(y,2), y=y'; end
 
   if ~isempty(find(isnan(x)))
      disp('Warning: NaN detected (in first variable) - will be cleared.')
@@ -281,9 +287,6 @@ if isnumeric(varargin{1}) 		% read commandline input
      disp('Warning: NaN detected (in second variable) - will be cleared.')
      for k=1:size(y,2),  y(find(isnan(y(:,k))),:)=[]; end
   end
-     
-  if size(x,1)<size(x,2), x=x'; end
-  if size(y,1)<size(y,2), y=y'; end
 
     Nx=length(x); Ny=length(y);
     NX=Nx-t*(m-1);NY=Ny-t*(m-1);