Cleaned version from internal CEDA svn