diff --git a/descriptors/d2/d2_base.cpp b/descriptors/d2/d2_base.cpp
index 017b0ce5223745e7e82d95a1066e7fdb14fe2650..c1b6561b47f36cc9bf37f067891c0adc2379e663 100644
--- a/descriptors/d2/d2_base.cpp
+++ b/descriptors/d2/d2_base.cpp
@@ -4,8 +4,8 @@ void D2_Base::calc_fd_approx(
         const double ,
         const double ,
         const double ,
-        aed_rtype aedp,
-        aed_rtype aedn,
+        aed_type2& aedp,
+        aed_type2& aedn,
         fd_type &fd_ij,
         const double h) {
 
diff --git a/descriptors/d2/d2_base.h b/descriptors/d2/d2_base.h
index 6ff85dba928f04fd656c1ba2c5b440eb1d3a6784..2ca5df48900590bc2ee8d363bb791dbf683254af 100644
--- a/descriptors/d2/d2_base.h
+++ b/descriptors/d2/d2_base.h
@@ -20,7 +20,7 @@ class D2_Base: public D_Base {
                 const double rij,
                 const double rij_sq,
                 const double fc_ij,
-                aed_rtype aed)=0;
+                aed_type2& aed)=0;
 
         /** \brief Calculate \ref FD
          *
@@ -49,8 +49,8 @@ class D2_Base: public D_Base {
         const double rij,
         const double fcijp,
         const double fcijn,
-        aed_rtype aedp,
-        aed_rtype aedn,
+        aed_type2& aedp,
+        aed_type2& aedn,
         fd_type &fd_ij,
         const double h);
 
@@ -60,7 +60,7 @@ class D2_Base: public D_Base {
                 const double rij_sq,
                 const double fc_ij,
                 const double fcp_ij,
-                aed_rtype aed,
+                aed_type2& aed,
                 fd_type &fd_ij)=0;
         virtual std::string label()=0;
 };
diff --git a/descriptors/d2/d2_blip.cpp b/descriptors/d2/d2_blip.cpp
index 35640daf64e59f191ca18fb904691791147ef75d..d8571b1cdfa74356a2af05207c4cd24754aa21a8 100644
--- a/descriptors/d2/d2_blip.cpp
+++ b/descriptors/d2/d2_blip.cpp
@@ -35,7 +35,7 @@ void D2_Blip::calc_aed(
         const double rij,
         const double ,
         const double fc_ij,
-        aed_rtype aed)
+        aed_type2 &aed)
 {
 
     size_t i=fidx;
@@ -62,7 +62,7 @@ void D2_Blip::calc_all(
         const double ,
         const double fc_ij,
         const double fcp_ij,
-        aed_rtype aed,
+        aed_type2 &aed,
         fd_type &fd_ij)
 {
 
diff --git a/descriptors/d2/d2_blip.h b/descriptors/d2/d2_blip.h
index beb7d762af4d58c3924fb8932cc4443e3eb763be..50a44544fb20dce2ac4b13d2abb468a373ddd409 100644
--- a/descriptors/d2/d2_blip.h
+++ b/descriptors/d2/d2_blip.h
@@ -57,7 +57,7 @@ class D2_Blip : public D2_Base {
                 const double rij,
                 const double rij_sq,
                 const double fc_ij,
-                aed_rtype aed);
+                aed_type2 &aed);
         void calc_dXijdri(
                 const double rij,
                 const double rij_sq,
@@ -69,7 +69,7 @@ class D2_Blip : public D2_Base {
                 const double rij_sq,
                 const double fc_ij,
                 const double fcp_ij,
-                aed_rtype aed,
+                aed_type2 &aed,
                 fd_type &fd_ij);
         size_t size();
         std::string label();
diff --git a/descriptors/d2/d2_bp.cpp b/descriptors/d2/d2_bp.cpp
index abdce9df95010d09363ad5bfb2b434a8d713745c..9ab3863b719d33875352e0b6edc3fad1918aaef7 100644
--- a/descriptors/d2/d2_bp.cpp
+++ b/descriptors/d2/d2_bp.cpp
@@ -34,7 +34,7 @@ void D2_BP::calc_aed(
         const double rij,
         const double ,
         const double fc_ij,
-        aed_rtype aed)
+        aed_type2 &aed)
 {
 
     size_t i=fidx;
@@ -60,7 +60,7 @@ void D2_BP::calc_all(
         const double ,
         const double fc_ij,
         const double fcp_ij,
-        aed_rtype aed,
+        aed_type2 &aed,
         fd_type &fd_ij)
 {
 
diff --git a/descriptors/d2/d2_bp.h b/descriptors/d2/d2_bp.h
index d73e87371d518ef8747a97ba056ecbb5757d0a3e..26ea63e15cef6151037d09c6b7b20a54a9fc2265 100644
--- a/descriptors/d2/d2_bp.h
+++ b/descriptors/d2/d2_bp.h
@@ -38,7 +38,7 @@ class D2_BP : public D2_Base {
                 const double rij,
                 const double ,
                 const double fc_ij,
-                aed_rtype aed);
+                aed_type2 &aed);
         void calc_dXijdri(
                 const double rij,
                 const double ,
@@ -50,7 +50,7 @@ class D2_BP : public D2_Base {
                 const double ,
                 const double fc_ij,
                 const double fcp_ij,
-                aed_rtype aed,
+                aed_type2 &aed,
                 fd_type &fd_ij);
         size_t size();
         std::string label();
diff --git a/descriptors/d2/d2_dummy.cpp b/descriptors/d2/d2_dummy.cpp
index 4ea73bac21fe1eaef4706da13aee7eb353aa14b9..7c0383a5947abce1a8bb1bd731f10c7e76d34b12 100644
--- a/descriptors/d2/d2_dummy.cpp
+++ b/descriptors/d2/d2_dummy.cpp
@@ -11,7 +11,7 @@ void D2_Dummy::calc_aed(
         const double,
         const double,
         const double,
-        aed_rtype ) {}
+        aed_type2 & ) {}
 void D2_Dummy::calc_dXijdri(
         const double,
         const double,
@@ -23,7 +23,7 @@ void D2_Dummy::calc_all(
         const double,
         const double,
         const double,
-        aed_rtype ,
+        aed_type2 & ,
         fd_type &) {}
 size_t D2_Dummy::size() { return s; }
 std::string D2_Dummy::label() { return lab; }
diff --git a/descriptors/d2/d2_dummy.h b/descriptors/d2/d2_dummy.h
index 87a73fd640747397e04ce4ea42c1d1194c3a4b0a..df4e145e22e060f794bb3af815399845eea73309 100644
--- a/descriptors/d2/d2_dummy.h
+++ b/descriptors/d2/d2_dummy.h
@@ -21,7 +21,7 @@ class D2_Dummy : public D2_Base {
                 const double,
                 const double,
                 const double,
-                aed_rtype aed);
+                aed_type2 &aed);
         void calc_dXijdri(
                 const double,
                 const double,
@@ -33,7 +33,7 @@ class D2_Dummy : public D2_Base {
                 const double,
                 const double,
                 const double,
-                aed_rtype aed,
+                aed_type2 &aed,
                 fd_type &fd_ij);
         size_t size();
         std::string label();
diff --git a/descriptors/d2/d2_eam.cpp b/descriptors/d2/d2_eam.cpp
index 99bcbf14837cb16641cc83133e0c88dfabe989cb..47be89a45ce2d60693aab292081cac1a689b22e1 100644
--- a/descriptors/d2/d2_eam.cpp
+++ b/descriptors/d2/d2_eam.cpp
@@ -40,7 +40,7 @@ void D2_EAM::calc_aed(
 		const double rij,
 		const double,
 		const double,
-		aed_rtype aed)
+		aed_type2 &aed)
 {
 
 	double r = rij;
@@ -83,7 +83,7 @@ void D2_EAM::calc_all(
 		const double,
 		const double,
 		const double,
-		aed_rtype aed,
+		aed_type2 &aed,
 		fd_type &fd_ij)
 {
 	double r = rij;
diff --git a/descriptors/d2/d2_eam.h b/descriptors/d2/d2_eam.h
index 6a8545d4b33e1404df48af0e6fc8a37a71cae56b..35f9fe18c3e490967a9eed597efe5cf703636cf4 100644
--- a/descriptors/d2/d2_eam.h
+++ b/descriptors/d2/d2_eam.h
@@ -59,7 +59,7 @@ class D2_EAM : public D2_Base {
                 double rij,
                 const double rij_sq,
                 const double,
-                aed_rtype aed);
+                aed_type2 &aed);
         void calc_dXijdri(
                 double rij,
                 const double rij_sq,
@@ -71,7 +71,7 @@ class D2_EAM : public D2_Base {
                 const double rij_sq,
                 const double,
                 const double,
-                aed_rtype aed,
+                aed_type2 &aed,
                 fd_type &fd_ij);
         size_t size();
         std::string label();
diff --git a/descriptors/d2/d2_lj.cpp b/descriptors/d2/d2_lj.cpp
index b0523480ce34325794b55aea3e7983028c2571c5..05eedd69b412d374ff06f4239c6e72f8d66799ee 100644
--- a/descriptors/d2/d2_lj.cpp
+++ b/descriptors/d2/d2_lj.cpp
@@ -14,7 +14,7 @@ void D2_LJ::calc_aed(
         const double,
         const double rij_sq,
         const double fc_ij,
-        aed_rtype aed)
+        aed_type2 &aed)
 {
     double r2_inv = 1.0/rij_sq;
     double r6_inv = r2_inv*r2_inv*r2_inv;
@@ -41,7 +41,7 @@ void D2_LJ::calc_all(
         const double rij_sq,
         const double fc_ij,
         const double fcp_ij,
-        aed_rtype aed,
+        aed_type2 &aed,
         fd_type &fd_ij)
 {
     double r2_inv = 1.0/rij_sq;
diff --git a/descriptors/d2/d2_lj.h b/descriptors/d2/d2_lj.h
index a1a3f8dd6d3dfed2d4eb41924e30b7248dd5875c..93bce92f66afd4032287b71c9683b295bea01d1b 100644
--- a/descriptors/d2/d2_lj.h
+++ b/descriptors/d2/d2_lj.h
@@ -39,7 +39,7 @@ class D2_LJ : public D2_Base {
                 const double,
                 const double rij_sq,
                 const double fc_ij,
-                aed_rtype aed);
+                aed_type2 &aed);
         void calc_dXijdri(
                 const double rij,
                 const double rij_sq,
@@ -51,7 +51,7 @@ class D2_LJ : public D2_Base {
                 const double rij_sq,
                 const double fc_ij,
                 const double fcp_ij,
-                aed_rtype aed,
+                aed_type2 &aed,
                 fd_type &fd_ij);
         size_t size();
         std::string label();
diff --git a/descriptors/d2/d2_mie.cpp b/descriptors/d2/d2_mie.cpp
index d17366417d8a3e677120cd330588822189e8cc2f..cf43d9f792c5553b6d1669f481327e2d2e296a37 100644
--- a/descriptors/d2/d2_mie.cpp
+++ b/descriptors/d2/d2_mie.cpp
@@ -25,7 +25,7 @@ void D2_MIE::calc_aed(
         const double rij,
         const double,
         const double fc_ij,
-        aed_rtype aed)
+        aed_type2 &aed)
 {
     double rn_inv = 1.0/pow(rij,n);
     double rm_inv = 1.0/pow(rij,m);
@@ -50,7 +50,7 @@ void D2_MIE::calc_all(
         const double,
         const double fc_ij,
         const double fcp_ij,
-        aed_rtype aed,
+        aed_type2 &aed,
         fd_type &fd_ij)
 {
 
diff --git a/descriptors/d2/d2_mie.h b/descriptors/d2/d2_mie.h
index 054fb221acbefb0774bac9a41e163eae4f27f160..073e2d78495ee1e03ea237f041763f6fc28a78f5 100644
--- a/descriptors/d2/d2_mie.h
+++ b/descriptors/d2/d2_mie.h
@@ -34,7 +34,7 @@ class D2_MIE : public D2_Base {
                 const double,
                 const double rij_sq,
                 const double fc_ij,
-                aed_rtype aed);
+                aed_type2 &aed);
         void calc_dXijdri(
                 const double rij,
                 const double rij_sq,
@@ -46,7 +46,7 @@ class D2_MIE : public D2_Base {
                 const double rij_sq,
                 const double fc_ij,
                 const double fcp_ij,
-                aed_rtype aed,
+                aed_type2 &aed,
                 fd_type &fd_ij);
         size_t size();
         std::string label();
diff --git a/descriptors/d3/d3_base.h b/descriptors/d3/d3_base.h
index 281932a89db29a8ce063d0c4929ff66f04c6f0cf..837b2471e3c21077a497ba98ccfdcb49bfc9dd92 100644
--- a/descriptors/d3/d3_base.h
+++ b/descriptors/d3/d3_base.h
@@ -13,7 +13,7 @@ class D3_Base: public D_Base {
                 const double rik,
                 const double fc_ij,
                 const double fc_ik,
-                aed_rtype aed)=0;
+                aed_type2& aed)=0;
         virtual void calc_fd(
                 const size_t fidx,
                 const double rij,
@@ -31,7 +31,7 @@ class D3_Base: public D_Base {
                 const double fc_ik,
                 const double fcp_ij,
                 const double fcp_ik,
-                aed_rtype aed,
+                aed_type2& aed,
                 fd_type &fd_ij)=0;
         virtual size_t size()=0;
         virtual std::string label()=0;
diff --git a/descriptors/d3/d3_dummy.cpp b/descriptors/d3/d3_dummy.cpp
index c145bfd552d087e758dbe6ae6d6fe11d5982b66f..12d00744bcacdcb1e383549ff4f13049d316bf9c 100644
--- a/descriptors/d3/d3_dummy.cpp
+++ b/descriptors/d3/d3_dummy.cpp
@@ -11,7 +11,7 @@ void D3_Dummy::calc_aed(
         const double,
         const double,
         const double,
-        aed_rtype ) {}
+        aed_type2& ) {}
 void D3_Dummy::calc_fd(
         const size_t,
         const double,
@@ -29,7 +29,7 @@ void D3_Dummy::calc_all(
         const double,
         const double,
         const double,
-        aed_rtype ,
+        aed_type2& ,
         fd_type &) {}
 size_t D3_Dummy::size() { return s;}
 std::string D3_Dummy::label() {return lab;}
diff --git a/descriptors/d3/d3_dummy.h b/descriptors/d3/d3_dummy.h
index 616b08a021e7e6159589baf8c9d1355b1f66cb37..d4d4925d3e6a2b9b3efb6d8ba56c6a414edb946f 100644
--- a/descriptors/d3/d3_dummy.h
+++ b/descriptors/d3/d3_dummy.h
@@ -14,7 +14,7 @@ class D3_Dummy: public D3_Base {
                 const double rik,
                 const double fc_ij,
                 const double fc_ik,
-                aed_rtype aed);
+                aed_type2& aed);
         void calc_fd(
                 const size_t fidx,
                 const double rij,
@@ -32,7 +32,7 @@ class D3_Dummy: public D3_Base {
                 const double fc_ik,
                 const double fcp_ij,
                 const double fcp_ik,
-                aed_rtype aed,
+                aed_type2& aed,
                 fd_type &fd_ij);
         size_t size();
         std::string label();
diff --git a/descriptors/dm/dm_base.h b/descriptors/dm/dm_base.h
index 5062a7b044bbf0e20b62ddcf5c68fa7d330d18d6..89ac3b6684d537579e032874c03c76eddbfba986 100644
--- a/descriptors/dm/dm_base.h
+++ b/descriptors/dm/dm_base.h
@@ -19,7 +19,7 @@ class DM_Base: public D_Base {
          */
         virtual void calc_aed(
                 rho_rtype rho,
-                aed_rtype aed)=0;
+                aed_type2 &aed)=0;
 
         /** \brief Calculate \ref FD
          *
diff --git a/descriptors/dm/dm_blip.cpp b/descriptors/dm/dm_blip.cpp
index abd287e540ad91af483e29a2b0e3d6ba532fa809..68b1adb62b036e70a0dc0fb5583a946544803470 100644
--- a/descriptors/dm/dm_blip.cpp
+++ b/descriptors/dm/dm_blip.cpp
@@ -39,7 +39,7 @@ DM_Blip::DM_Blip(Config &c):
 
 void DM_Blip::calc_aed(
         rho_rtype rhoi,
-        aed_rtype aed)
+        aed_type2 &aed)
 {
     size_t Lshift = 0;
     size_t ii=0;
diff --git a/descriptors/dm/dm_blip.h b/descriptors/dm/dm_blip.h
index 9f6eab4ed1a288e8d1e5405c36a261a8ae63242c..a95c51036a13395adfbc0d998e1db0646f7eae9a 100644
--- a/descriptors/dm/dm_blip.h
+++ b/descriptors/dm/dm_blip.h
@@ -55,7 +55,7 @@ class DM_Blip: public DM_Base {
         DM_Blip(Config&);
         void calc_aed(
                 rho_rtype rho,
-                aed_rtype aed);
+                aed_type2 &aed);
         int calc_dXijdri_dXjidri(
                 const double rij,
                 const double rij_sq,
diff --git a/descriptors/dm/dm_dummy.cpp b/descriptors/dm/dm_dummy.cpp
index e104902000edb95ff3ecd3ddc0ce9502228064a0..8ff48524a99020c0d6c6b52a2d17e648319281a6 100644
--- a/descriptors/dm/dm_dummy.cpp
+++ b/descriptors/dm/dm_dummy.cpp
@@ -6,7 +6,7 @@ DM_Dummy::DM_Dummy() {}
 DM_Dummy::DM_Dummy(Config&) {}
 void DM_Dummy::calc_aed(
         rho_rtype,
-        aed_rtype ) {}
+        aed_type2 & ) {}
 int DM_Dummy::calc_dXijdri_dXjidri(
         const double,
         const double,
diff --git a/descriptors/dm/dm_dummy.h b/descriptors/dm/dm_dummy.h
index dab69790ebccc8fd5a457397836f7739df919043..3d699261d5f0d39c23ccf91c4e677de164973a76 100644
--- a/descriptors/dm/dm_dummy.h
+++ b/descriptors/dm/dm_dummy.h
@@ -18,7 +18,7 @@ class DM_Dummy: public DM_Base {
         DM_Dummy(Config&);
         void calc_aed(
                 rho_rtype rho,
-                aed_rtype aed);
+                aed_type2 &aed);
         int calc_dXijdri_dXjidri(
                 const double rij,
                 const double rij_sq,
diff --git a/descriptors/dm/dm_ead.cpp b/descriptors/dm/dm_ead.cpp
index 0ad486295c0866b2f36c196cfee908bcc708b641..7b4d1d263211412e60863a7bf993dd1c55cd3315 100644
--- a/descriptors/dm/dm_ead.cpp
+++ b/descriptors/dm/dm_ead.cpp
@@ -43,7 +43,7 @@ DM_EAD::DM_EAD(Config &config):
 
 void DM_EAD::calc_aed(
         rho_rtype rhoi,
-        aed_rtype aed)
+        aed_type2 &aed)
 {
     size_t Lshift = 0;
     size_t ii=0;
diff --git a/descriptors/dm/dm_ead.h b/descriptors/dm/dm_ead.h
index bc93bc9aaff20b72c6adf2ce0d14c74aae0d8435..508ab7d617c34ce988c405273339cf8770b315d2 100644
--- a/descriptors/dm/dm_ead.h
+++ b/descriptors/dm/dm_ead.h
@@ -54,7 +54,7 @@ class DM_EAD: public DM_Base {
         DM_EAD(Config&);
         void calc_aed(
                 rho_rtype rho,
-                aed_rtype aed);
+                aed_type2 &aed);
         int calc_dXijdri_dXjidri(
                 const double rij,
                 const double rij_sq,
diff --git a/descriptors/dm/dm_eam.cpp b/descriptors/dm/dm_eam.cpp
index b2ea2ffdcf89f3f61263091a75505e668990fae4..98b681f7b8f12986053a2dcc4c13b2b4e9cb0f59 100644
--- a/descriptors/dm/dm_eam.cpp
+++ b/descriptors/dm/dm_eam.cpp
@@ -37,7 +37,7 @@ DM_EAM::DM_EAM(Config &c):
 
 void DM_EAM::calc_aed(
 		rho_rtype rho,
-		aed_rtype aed)
+		aed_type2 &aed)
 {
     //std::cout << "rho[i]:   " << rho(0) << std::endl;
     double p = rho(0)*ef.rdrho + 1.0;
diff --git a/descriptors/dm/dm_eam.h b/descriptors/dm/dm_eam.h
index 62c3c294b4d09dd7b0e257208fd38d9562446659..9d92f0119c83b4ae28053f0f7b5a5a7099b3ba76 100644
--- a/descriptors/dm/dm_eam.h
+++ b/descriptors/dm/dm_eam.h
@@ -58,7 +58,7 @@ class DM_EAM: public DM_Base {
         DM_EAM(Config&);
         void calc_aed(
                 rho_rtype rho,
-                aed_rtype aed);
+                aed_type2 &aed);
         int calc_dXijdri_dXjidri(
                 const double rij,
                 const double rij_sq,
diff --git a/descriptors/dm/dm_mEAD.cpp b/descriptors/dm/dm_mEAD.cpp
index 74ba53a3cb62a043495f4d8b80d4843209d9245e..a6e3e519a85e85f07980b9a43c8a94a19d09501b 100644
--- a/descriptors/dm/dm_mEAD.cpp
+++ b/descriptors/dm/dm_mEAD.cpp
@@ -47,7 +47,7 @@ DM_mEAD<F>::DM_mEAD(Config &config):
 template <typename F>
 void DM_mEAD<F>::calc_aed(
         rho_rtype rhoi,
-        aed_rtype aed)
+        aed_type2 &aed)
 {
     size_t Lshift = 0;
     size_t ii=0;
diff --git a/descriptors/dm/dm_mEAD.h b/descriptors/dm/dm_mEAD.h
index 45224e90b86ea9054376b60b9876cdc22c14c27d..0ccdd23874b388668b15f7acc5ee77b2029e4a8e 100644
--- a/descriptors/dm/dm_mEAD.h
+++ b/descriptors/dm/dm_mEAD.h
@@ -111,7 +111,7 @@ class DM_mEAD: public DM_Base, public F {
         DM_mEAD(Config&);
         void calc_aed(
                 rho_rtype rho,
-                aed_rtype aed);
+                aed_type2 &aed);
         int calc_dXijdri_dXjidri(
                 const double rij,
                 const double rij_sq,
diff --git a/ekm.h b/ekm.h
index 5f60bc487b52622259d5fc2a77e7a592ccdb4c35..562c0f5c21bc17f96237c9d0e9516c71fbdebdcb 100644
--- a/ekm.h
+++ b/ekm.h
@@ -14,7 +14,7 @@ class EKM {
             EKM(T &t):
                 kernel(t)
     {}
-        void configure(aeds_type &basis) {
+        void configure(aeds_type2 &basis) {
             // KK is temp matrix
             KK = Eigen::MatrixXd(basis.size(), basis.size());
 
@@ -39,7 +39,7 @@ class EKM {
                 Phi.row(i)= KK*Phi.row(i).transpose();
             }
         }
-        aed_type project(aed_rtype aed, aeds_type &basis) {
+        aed_type project(aed_type2 &aed, aeds_type2 &basis) {
             aed_type temp(basis.size());
             for (long int b=0; b<basis.cols(); b++) {
                 temp(b) = kernel(aed,basis[b]);
diff --git a/functions/basis_functions/bf_base.h b/functions/basis_functions/bf_base.h
index d76cd7194c918aaccedf85cf9f6ef1e8c3ae9384..533cf639233357573b727b0b189fbfe9225a91df 100644
--- a/functions/basis_functions/bf_base.h
+++ b/functions/basis_functions/bf_base.h
@@ -9,10 +9,10 @@
 /** \brief Base class to be used by all basis functions */
 struct BF_Base: public virtual Function_Base {
     virtual ~BF_Base();
-    virtual double epredict(const t_type &, const aed_rctype& )=0;
+    virtual double epredict(const t_type &, const aed_type2& )=0;
     virtual double fpredict(const t_type &, const fd_type &,
-            const aed_rctype& , const size_t )=0;
+            const aed_type2& , const size_t )=0;
     virtual force_type fpredict(const t_type &, const fd_type &,
-            const aed_rctype& )=0;
+            const aed_type2& )=0;
 };
 #endif
diff --git a/functions/basis_functions/bf_linear.cpp b/functions/basis_functions/bf_linear.cpp
index 1b427b17817535d9f8c060e6bdeee9468c27bcf8..6daabe0debe76aa9125ec3a39c807d68b8c4696b 100644
--- a/functions/basis_functions/bf_linear.cpp
+++ b/functions/basis_functions/bf_linear.cpp
@@ -9,17 +9,17 @@ BF_Linear::BF_Linear(const Config &c): Function_Base(c) {}
 std::string BF_Linear::get_label() {
     return label;
 }
-double BF_Linear::epredict(const t_type &weights, const aed_rctype& aed)
+double BF_Linear::epredict(const t_type &weights, const aed_type2& aed)
 {
     return weights.transpose()*aed;
 }
 double BF_Linear::fpredict(const t_type &weights, const fd_type &fdij,
-        const aed_rctype& , const size_t k)
+        const aed_type2& , const size_t k)
 {
     return -fdij.col(k).transpose() * weights;
 }
 force_type BF_Linear::fpredict(const t_type &weights, const fd_type &fdij,
-        const aed_rctype& )
+        const aed_type2& )
 {
     return -Vec3d(fdij.transpose() * weights);
 }
diff --git a/functions/basis_functions/bf_linear.h b/functions/basis_functions/bf_linear.h
index 6355fbbcb3a7b832ab0f62663400e6cc1471e764..7548c381d93d914cf72440450ae1d0075caaa06d 100644
--- a/functions/basis_functions/bf_linear.h
+++ b/functions/basis_functions/bf_linear.h
@@ -9,10 +9,10 @@ struct BF_Linear: public virtual BF_Base
     BF_Linear(const Config &c);
     std::string get_label();
     std::string label = "BF_Linear";
-    double epredict(const t_type &weights, const aed_rctype& aed);
+    double epredict(const t_type &weights, const aed_type2& aed);
     double fpredict(const t_type &weights, const fd_type &fdij,
-            const aed_rctype& aedi, const size_t k);
+            const aed_type2& aedi, const size_t k);
     force_type fpredict(const t_type &weights, const fd_type &fdij,
-            const aed_rctype& aedi);
+            const aed_type2& aedi);
 };
 #endif
diff --git a/functions/basis_functions/bf_polynomial2.cpp b/functions/basis_functions/bf_polynomial2.cpp
index 107b4c27893df753cca26237e323d351865ddf32..d30e522abe8f7531f088a32ca1c443edd149074c 100644
--- a/functions/basis_functions/bf_polynomial2.cpp
+++ b/functions/basis_functions/bf_polynomial2.cpp
@@ -10,19 +10,19 @@ std::string BF_Polynomial2::get_label()
 {
     return label;
 }
-double BF_Polynomial2::epredict(const t_type &weights, const aed_rctype& aed)
+double BF_Polynomial2::epredict(const t_type &weights, const aed_type2& aed)
 {
     size_t b=0;
     double res=0.0;
-    for (long int i=0; i<aed.size(); ++i) {
-        for (long int ii=i; ii<aed.size(); ++ii) {
+    for (size_t i=0; i<aed.size(); ++i) {
+        for (size_t ii=i; ii<aed.size(); ++ii) {
             res+= weights(b++)*aed(i)*aed(ii);
         }
     }
     return res;
 }
 double BF_Polynomial2::fpredict(const t_type &weights, const fd_type &fdij,
-        const aed_rctype& aedi, const size_t k)
+        const aed_type2& aedi, const size_t k)
 {
     double res=0.0;
     size_t b=0;
@@ -35,7 +35,7 @@ double BF_Polynomial2::fpredict(const t_type &weights, const fd_type &fdij,
     return res;
 }
 force_type BF_Polynomial2::fpredict(const t_type &weights, const fd_type &fdij,
-        const aed_rctype& aedi)
+        const aed_type2& aedi)
 {
     force_type v;
     v.setZero();
diff --git a/functions/basis_functions/bf_polynomial2.h b/functions/basis_functions/bf_polynomial2.h
index 65f421292f98dd45b561dcefc26ab60091aea188..95084230d6cb91226cc7f570f62ea4d68fab4dbd 100644
--- a/functions/basis_functions/bf_polynomial2.h
+++ b/functions/basis_functions/bf_polynomial2.h
@@ -9,10 +9,10 @@ struct BF_Polynomial2: public virtual BF_Base
     BF_Polynomial2(const Config &c);
     std::string label = "BF_Polynomial2";
     std::string get_label();
-    double epredict(const t_type &weights, const aed_rctype& aed);
+    double epredict(const t_type &weights, const aed_type2& aed);
     double fpredict(const t_type &weights, const fd_type &fdij,
-            const aed_rctype& aedi, const size_t k);
+            const aed_type2& aedi, const size_t k);
     force_type fpredict(const t_type &weights, const fd_type &fdij,
-            const aed_rctype& aedi);
+            const aed_type2& aedi);
 };
 #endif
diff --git a/functions/function_base.h b/functions/function_base.h
index 66d5823e30b56bd494aa2974d040d8f3879e1fbc..e1f6c5bf3237cbdedf475cc73543ab4904d5cffb 100644
--- a/functions/function_base.h
+++ b/functions/function_base.h
@@ -30,19 +30,19 @@ struct Function_Base {
         virtual ~Function_Base() {};
 
         // For Kernels
-        virtual double operator() (const aed_rctype& , const aed_rctype& ) { return 0.0; };
-        virtual aed_type derivative(const aed_rctype& , const aed_rctype& ) { return aed_type(); };
-        virtual double prime(const aed_rctype& , const aed_rctype& ,
-                const aed_rctype& ) { return 0.0; }
-        virtual void set_basis(const aeds_type ) {};
+        virtual double operator() (const aed_type2& , const aed_type2& ) { return 0.0; };
+        virtual aed_type2 derivative(const aed_type2& , const aed_type2& ) { return aed_type2(); };
+        virtual double prime(const aed_type2& , const aed_type2& ,
+                const aed_type2& ) { return 0.0; }
+        virtual void set_basis(const aeds_type2 ) {};
 
         /** \brief Return label of this object */
         virtual std::string get_label()=0;
-        virtual double epredict(const t_type &, const aed_rctype& )=0;
+        virtual double epredict(const t_type &, const aed_type2& )=0;
         virtual double fpredict(const t_type &, const fd_type &,
-                const aed_rctype&, const size_t )=0;
+                const aed_type2&, const size_t )=0;
         virtual force_type fpredict(const t_type &, const fd_type &,
-                const aed_rctype& )=0;
+                const aed_type2& )=0;
 };
 template<> inline Registry<Function_Base>::Map Registry<Function_Base>::registry{};
 template<> inline Registry<Function_Base,Config&>::Map Registry<Function_Base,Config&>::registry{};
diff --git a/functions/kernels/kern_base.cpp b/functions/kernels/kern_base.cpp
index 171af0c53d39cd657da304a126b9d7d9ee7facf2..6e132db8dcdd0368717369e1586789ae5b696c55 100644
--- a/functions/kernels/kern_base.cpp
+++ b/functions/kernels/kern_base.cpp
@@ -1,33 +1,33 @@
 #include "kern_base.h"
 
 Kern_Base::~Kern_Base() {}
-void Kern_Base::set_basis(const aeds_type b)
+void Kern_Base::set_basis(const aeds_type2 b)
 {
     basis = b;
 }
-double Kern_Base::epredict(const t_type &kweights, const aed_rctype &aed)
+double Kern_Base::epredict(const t_type &kweights, const aed_type2 &aed)
 {
     double energy=0;
-    for (long int b=0; b<basis.cols(); ++b) {
+    for (size_t b=0; b<basis.cols(); ++b) {
         energy += kweights[b]*(*this)(basis.col(b),aed);
     }
     return energy;
 }
 double Kern_Base::fpredict(const t_type &kweights, const fd_type &fdij,
-        const aed_rctype &aedi, const size_t k)
+        const aed_type2 &aedi, const size_t k)
 {
     double res=0.0;
-    for (long int b=0; b<basis.cols(); ++b) {
+    for (size_t b=0; b<basis.cols(); ++b) {
         res -= kweights[b]*(*this).prime(basis.col(b),aedi,fdij.col(k));
     }
     return res;
 }
 force_type Kern_Base::fpredict(const t_type &kweights, const fd_type &fdij,
-        const aed_rctype &aedi)
+        const aed_type2 &aedi)
 {
     force_type v;
     v.setZero();
-    for (long int b=0; b<basis.cols(); ++b) {
+    for (size_t b=0; b<basis.cols(); ++b) {
         for (size_t k=0; k<3; ++k) {
             v(k) -= kweights[b]*(*this).prime(basis.col(b),aedi,fdij.col(k));
         }
diff --git a/functions/kernels/kern_base.h b/functions/kernels/kern_base.h
index 4a620487860edda9f54037f46363b1195f2f2a35..fc94fbab743539ca12f6685f9c8a5ebf069f4c58 100644
--- a/functions/kernels/kern_base.h
+++ b/functions/kernels/kern_base.h
@@ -15,7 +15,7 @@
  */
 class Kern_Base: public virtual Function_Base {
     public:
-        aeds_type basis;
+        aeds_type2 basis;
         virtual ~Kern_Base();
 
         /**
@@ -24,7 +24,7 @@ class Kern_Base: public virtual Function_Base {
          * - b = basis vector
          * - af = atomic energy descriptor
          */
-        virtual double operator() (const aed_rctype &b, const aed_rctype &af)=0;
+        virtual double operator() (const aed_type2 &b, const aed_type2 &af)=0;
 
         /**
          * Calculate the kernel derivative wrt to the second argument
@@ -32,7 +32,7 @@ class Kern_Base: public virtual Function_Base {
          * - b = basis vector
          * - af = atomic energy descriptor
          */
-        virtual aed_type derivative(const aed_rctype &b, const aed_rctype &af)=0;
+        virtual aed_type2 derivative(const aed_type2 &b, const aed_type2 &af)=0;
 
         /**
          * Calculate inner product of the kernel derivative
@@ -43,16 +43,16 @@ class Kern_Base: public virtual Function_Base {
          * - ff = force descriptor (TODO i-th dir component of it)
          *   TODO consider calculating all 3-directions at once
          */
-        virtual double prime(const aed_rctype &b, const aed_rctype &af,
-                const aed_rctype &ff)=0;
+        virtual double prime(const aed_type2 &b, const aed_type2 &af,
+                const aed_type2 &ff)=0;
 
         /** \brief Set basis for calculations */
-        virtual void set_basis(const aeds_type b);
+        virtual void set_basis(const aeds_type2 b);
 
-        virtual double epredict(const t_type &kweights, const aed_rctype &aed);
+        virtual double epredict(const t_type &kweights, const aed_type2 &aed);
         virtual double fpredict(const t_type &kweights, const fd_type &fdij,
-                const aed_rctype &aedi, const size_t k);
+                const aed_type2 &aedi, const size_t k);
         virtual force_type fpredict(const t_type &kweights, const fd_type &fdij,
-                const aed_rctype &aedi);
+                const aed_type2 &aedi);
 };
 #endif
diff --git a/functions/kernels/kern_linear.cpp b/functions/kernels/kern_linear.cpp
index 3c80fb7579e4a0b88aae38e5e3ab8d7c8b41c5d0..201cc34fbd9a8caa97d9605dcaf4d6ca8607ac3d 100644
--- a/functions/kernels/kern_linear.cpp
+++ b/functions/kernels/kern_linear.cpp
@@ -7,15 +7,15 @@ Kern_Linear::Kern_Linear() {}
 Kern_Linear::Kern_Linear (const Config &c):
     Function_Base(c)
 {}
-double Kern_Linear::operator() (const aed_rctype& b, const aed_rctype& af)
+double Kern_Linear::operator() (const aed_type2& b, const aed_type2& af)
 {
     return b.transpose()*af;;
 }
-aed_type Kern_Linear::derivative(const aed_rctype& b, const aed_rctype&)
+aed_type2 Kern_Linear::derivative(const aed_type2& b, const aed_type2&)
 {
     return b;
 }
-double Kern_Linear::prime(const aed_rctype& b, const aed_rctype& , const aed_rctype& ff)
+double Kern_Linear::prime(const aed_type2& b, const aed_type2& , const aed_type2& ff)
 {
     // return derivative(b,af).transpose() * ff;
     return b.transpose() * ff;
@@ -24,17 +24,17 @@ std::string Kern_Linear::get_label()
 {
     return label;
 }
-double Kern_Linear::epredict(const t_type &weights, const aed_rctype& aed)
+double Kern_Linear::epredict(const t_type &weights, const aed_type2& aed)
 {
     return weights.transpose()*aed;
 }
 double Kern_Linear::fpredict(const t_type &weights, const fd_type &fdij,
-        const aed_rctype& , const size_t k)
+        const aed_type2& , const size_t k)
 {
     return -fdij.col(k).transpose() * weights;
 }
 force_type Kern_Linear::fpredict(const t_type &weights, const fd_type &fdij,
-        const aed_rctype& )
+        const aed_type2& )
 {
     return -fdij.transpose() * weights;
 }
diff --git a/functions/kernels/kern_linear.h b/functions/kernels/kern_linear.h
index cbad9db39c5f008bd10ff61b5bfe7e966143488d..aa90767395e8fd11e978a08457dffc92c2799847 100644
--- a/functions/kernels/kern_linear.h
+++ b/functions/kernels/kern_linear.h
@@ -22,15 +22,15 @@ class Kern_Linear :  public virtual Kern_Base {
          * Label used for this class
          */
         std::string label = "Kern_Linear";
-        double operator() (const aed_rctype& b, const aed_rctype& af);
-        aed_type derivative(const aed_rctype& b, const aed_rctype& );
-        double prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff);
-        void set_basis(const aeds_type ) {}
+        double operator() (const aed_type2& b, const aed_type2& af);
+        aed_type2 derivative(const aed_type2& b, const aed_type2& );
+        double prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff);
+        void set_basis(const aeds_type2 ) {}
 
-        double epredict(const t_type &weights, const aed_rctype& aed);
+        double epredict(const t_type &weights, const aed_type2& aed);
         double fpredict(const t_type &weights, const fd_type &fdij,
-                const aed_rctype& aedi, const size_t k);
+                const aed_type2& aedi, const size_t k);
         force_type fpredict(const t_type &weights, const fd_type &fdij,
-                const aed_rctype& aedi);
+                const aed_type2& aedi);
 };
 #endif
diff --git a/functions/kernels/kern_lq.cpp b/functions/kernels/kern_lq.cpp
index 82b3db722d0667921886de8f3dc1bf88f2e66ac3..3b2f7efedb0edc5cf26ab81bca292dad044b7ec7 100644
--- a/functions/kernels/kern_lq.cpp
+++ b/functions/kernels/kern_lq.cpp
@@ -9,17 +9,17 @@ Kern_LQ::Kern_LQ (const Config &c):
 {
     if (get_verbose()) std::cout << std::endl << label << std::endl;
 }
-double Kern_LQ::operator() (const aed_rctype& b, const aed_rctype& af)
+double Kern_LQ::operator() (const aed_type2& b, const aed_type2& af)
 {
     double x = b.transpose()*af;
     return x*x + x;
 }
-aed_type Kern_LQ::derivative(const aed_rctype& b, const aed_rctype& af)
+aed_type2 Kern_LQ::derivative(const aed_type2& b, const aed_type2& af)
 {
     double temp = 2.0 * b.transpose()*af;
     return temp*b + b;
 }
-double Kern_LQ::prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff)
+double Kern_LQ::prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff)
 {
     return derivative(b, af).transpose()*ff;
 }
diff --git a/functions/kernels/kern_lq.h b/functions/kernels/kern_lq.h
index 9d5bd19b3ffb3684715b73c9865f3b03f042bffe..62f582d6008ce5b6a6c0abe11bf19638abab686e 100644
--- a/functions/kernels/kern_lq.h
+++ b/functions/kernels/kern_lq.h
@@ -23,9 +23,9 @@ class Kern_LQ : public virtual Kern_Base {
          * Label used for this class
          */
         std::string label = "Kern_LQ";
-        double operator() (const aed_rctype& b, const aed_rctype& af);
-        aed_type derivative(const aed_rctype& b, const aed_rctype& af);
-        double prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff);
+        double operator() (const aed_type2& b, const aed_type2& af);
+        aed_type2 derivative(const aed_type2& b, const aed_type2& af);
+        double prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff);
         std::string get_label();
 
 };
diff --git a/functions/kernels/kern_polynomial.cpp b/functions/kernels/kern_polynomial.cpp
index 01dcf5e21f8f69e3ae29f414211881b405c1beb7..4b2f5d1500d974d81b00549a3c526d88da48bbc9 100644
--- a/functions/kernels/kern_polynomial.cpp
+++ b/functions/kernels/kern_polynomial.cpp
@@ -13,15 +13,15 @@ Kern_Polynomial::Kern_Polynomial (const Config &c):
     if (get_verbose()) std::cout << std::endl << label << " | degree: " << d
         <<" | gamma: " << gamma << " | c: " << c << std::endl;
 }
-double Kern_Polynomial::operator() (const aed_rctype& b, const aed_rctype& af)
+double Kern_Polynomial::operator() (const aed_type2& b, const aed_type2& af)
 {
-    return std::pow(gamma*(b.dot(af))+c,d);
+    return std::pow(gamma*(b*af)+c,d);
 }
-aed_type Kern_Polynomial::derivative(const aed_rctype& b, const aed_rctype& af)
+aed_type2 Kern_Polynomial::derivative(const aed_type2& b, const aed_type2& af)
 {
-    return  d*gamma*std::pow(gamma*(b.dot(af))+c,d-1)*b;
+    return  d*gamma*std::pow(gamma*(b*af)+c,d-1)*b;
 }
-double Kern_Polynomial::prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff)
+double Kern_Polynomial::prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff)
 {
     return derivative(b, af).transpose()*ff;
 }
diff --git a/functions/kernels/kern_polynomial.h b/functions/kernels/kern_polynomial.h
index 02bf26262d3d044c338a2e1fc7e1e9a8b4d853b9..4d281ceaa3faba31dd66852c5773758ecb17ad7f 100644
--- a/functions/kernels/kern_polynomial.h
+++ b/functions/kernels/kern_polynomial.h
@@ -26,9 +26,9 @@ class Kern_Polynomial : public virtual Kern_Base {
          */
         std::string label = "Kern_Polynomial";
         std::string get_label();
-        double operator() (const aed_rctype& b, const aed_rctype& af);
-        aed_type derivative(const aed_rctype& b, const aed_rctype& af);
-        double prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff);
+        double operator() (const aed_type2& b, const aed_type2& af);
+        aed_type2 derivative(const aed_type2& b, const aed_type2& af);
+        double prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff);
 
 };
 #endif
diff --git a/functions/kernels/kern_quadratic.cpp b/functions/kernels/kern_quadratic.cpp
index 0d61f734710c1a39e86fa23ab88d2c9a5858a214..60ba58c3b57b6067c606534a15a783a4f2dfbe55 100644
--- a/functions/kernels/kern_quadratic.cpp
+++ b/functions/kernels/kern_quadratic.cpp
@@ -9,17 +9,17 @@ Kern_Quadratic::Kern_Quadratic (const Config &c):
 {
     if (get_verbose()) std::cout << std::endl << label << std::endl;
 }
-double Kern_Quadratic::operator() (const aed_rctype& b, const aed_rctype& af)
+double Kern_Quadratic::operator() (const aed_type2& b, const aed_type2& af)
 {
     double x = b.transpose()*af;
     return  x*x;
 }
-aed_type Kern_Quadratic::derivative(const aed_rctype& b, const aed_rctype& af)
+aed_type2 Kern_Quadratic::derivative(const aed_type2& b, const aed_type2& af)
 {
     double temp = 2.0 * b.transpose()*af;
     return b*temp;;
 }
-double Kern_Quadratic::prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff)
+double Kern_Quadratic::prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff)
 {
     //return dot(derivative(b, af), ff);
     // it is faster this way
diff --git a/functions/kernels/kern_quadratic.h b/functions/kernels/kern_quadratic.h
index d9e886bb54253afc4ee918bf98319f117887cc45..fef8b5b33929b5ce0e75cf58e20a98792296483f 100644
--- a/functions/kernels/kern_quadratic.h
+++ b/functions/kernels/kern_quadratic.h
@@ -21,9 +21,9 @@ class Kern_Quadratic : public virtual Kern_Base {
          * Label used for this class
          */
         std::string label = "Kern_Quadratic";
-        double operator() (const aed_rctype& b, const aed_rctype& af);
-        aed_type derivative(const aed_rctype& b, const aed_rctype& af);
-        double prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff);
+        double operator() (const aed_type2& b, const aed_type2& af);
+        aed_type2 derivative(const aed_type2& b, const aed_type2& af);
+        double prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff);
         std::string get_label();
 
 };
diff --git a/functions/kernels/kern_rbf.cpp b/functions/kernels/kern_rbf.cpp
index a96a9352feb4e8462f1f5ad8fd1eb6c4428ad93d..b26dfe533be49e747ee179f58853a5cc0a8741e3 100644
--- a/functions/kernels/kern_rbf.cpp
+++ b/functions/kernels/kern_rbf.cpp
@@ -12,16 +12,16 @@ Kern_RBF::Kern_RBF (const Config &c):
     if (get_verbose()) std::cout << std::endl << label << " | sigma: " << sigma
         << " | gamma: " << gamma << std::endl;
 }
-double Kern_RBF::operator() (const aed_rctype& b, const aed_rctype& af)
+double Kern_RBF::operator() (const aed_type2& b, const aed_type2& af)
 {
-    const aed_type v = af-b;
-    return exp(-gamma*(v.dot(v)));
+    const aed_type2 v = af-b;
+    return exp(-gamma*(v*v));
 }
-aed_type Kern_RBF::derivative(const aed_rctype& b, const aed_rctype& af)
+aed_type2 Kern_RBF::derivative(const aed_type2& b, const aed_type2& af)
 {
     return  -2.0*gamma*(af-b)*(*this)(af,b);
 }
-double Kern_RBF::prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff)
+double Kern_RBF::prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff)
 {
     return derivative(b, af).transpose()*ff;
 }
diff --git a/functions/kernels/kern_rbf.h b/functions/kernels/kern_rbf.h
index d91c493ffa0ed3a5f89bc17471968af41dc40419..6b76845245371771e8d1610243ad4faf98b4921f 100644
--- a/functions/kernels/kern_rbf.h
+++ b/functions/kernels/kern_rbf.h
@@ -23,9 +23,9 @@ class Kern_RBF : public virtual Kern_Base {
         Kern_RBF ();
         Kern_RBF (const Config &c);
         std::string label = "Kern_RBF";
-        double operator() (const aed_rctype& b, const aed_rctype& af);
-        aed_type derivative(const aed_rctype& b, const aed_rctype& af);
-        double prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff);
+        double operator() (const aed_type2& b, const aed_type2& af);
+        aed_type2 derivative(const aed_type2& b, const aed_type2& af);
+        double prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff);
         std::string get_label();
 
     private:
diff --git a/functions/kernels/kern_sigmoid.cpp b/functions/kernels/kern_sigmoid.cpp
index 6f0c9470844d9b359ff2394250836db03d19f1f2..8ce2e835ae151b9fcf7c987fffd7b861c57e839e 100644
--- a/functions/kernels/kern_sigmoid.cpp
+++ b/functions/kernels/kern_sigmoid.cpp
@@ -12,15 +12,15 @@ Kern_Sigmoid::Kern_Sigmoid (const Config &c):
     if (get_verbose()) std::cout << std::endl << label << " | gamma: " << gamma 
         << " | c: " << c << std::endl;
 }
-double Kern_Sigmoid::operator() (const aed_rctype& b, const aed_rctype& af)
+double Kern_Sigmoid::operator() (const aed_type2& b, const aed_type2& af)
 {
-    return std::tanh(gamma*(b.dot(af))+c);
+    return std::tanh(gamma*(b*af)+c);
 }
-aed_type Kern_Sigmoid::derivative(const aed_rctype& b, const aed_rctype& af)
+aed_type2 Kern_Sigmoid::derivative(const aed_type2& b, const aed_type2& af)
 {
     return gamma*(1.0-std::pow((*this)(af,b),2))*b;
 }
-double Kern_Sigmoid::prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff)
+double Kern_Sigmoid::prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff)
 {
     return derivative(b, af).transpose()*ff;
 }
diff --git a/functions/kernels/kern_sigmoid.h b/functions/kernels/kern_sigmoid.h
index 600251af6dee361421fc755d841b72ad45033165..e94c79aac4e2b1da6f48f41869945b443d227a42 100644
--- a/functions/kernels/kern_sigmoid.h
+++ b/functions/kernels/kern_sigmoid.h
@@ -24,9 +24,9 @@ class Kern_Sigmoid : public virtual Kern_Base {
         Kern_Sigmoid ();
         Kern_Sigmoid (const Config &c);
         std::string label = "Kern_Sigmoid";
-        double operator() (const aed_rctype& b, const aed_rctype& af);
-        aed_type derivative(const aed_rctype& b, const aed_rctype& af);
-        double prime(const aed_rctype& b, const aed_rctype& af, const aed_rctype& ff);
+        double operator() (const aed_type2& b, const aed_type2& af);
+        aed_type2 derivative(const aed_type2& b, const aed_type2& af);
+        double prime(const aed_type2& b, const aed_type2& af, const aed_type2& ff);
         std::string get_label();
 
 };
diff --git a/m_core.h b/m_core.h
index c2783bd7642d651a3dd16593b884ebd43d96ca1a..0d9c042a481b0ae8fce09cf0b2b989bb14a2b39b 100644
--- a/m_core.h
+++ b/m_core.h
@@ -38,14 +38,14 @@ class M_Predict {
          *  If aed contains sum over all nearest neighbours than the result is
          *  a local atomic energy \f$ E_i \f$.
          * */
-        virtual double epredict(const aed_rctype &aed)=0;
+        virtual double epredict(const aed_type2 &aed)=0;
 
         /** \brief Predict force between a pair of atoms in a k-direction. */
-        virtual double fpredict(const fd_type &fdij, const aed_rctype &aedi, size_t k)=0;
+        virtual double fpredict(const fd_type &fdij, const aed_type2 &aedi, size_t k)=0;
 
         /** \brief Predict force between a pair of atoms. */
         virtual force_type fpredict(const fd_type &fdij,
-                const aed_rctype &aedi)=0;
+                const aed_type2 &aedi)=0;
 };
 class M_Train {
     public:
diff --git a/m_krr_core.h b/m_krr_core.h
index ff7b37016a43e6e3437fa46c005395501367f75d..e228141dab1e15d7951dba3067e55457b88767ac 100644
--- a/m_krr_core.h
+++ b/m_krr_core.h
@@ -83,15 +83,15 @@ class M_KRR_Core:
 //            M_KRR_Core<K>(kernel, c)
 //    {}
 //
-//        double epredict(const aed_rctype &aed) {
+//        double epredict(const aed_type2 &aed) {
 //            return kernel.epredict(weights,aed);
 //        };
 //
-//        double fpredict(const fd_type &fdij, const aed_rctype &aedi, const size_t k) {
+//        double fpredict(const fd_type &fdij, const aed_type2 &aedi, const size_t k) {
 //            return kernel.fpredict(weights,fdij,aedi,k);
 //        }
 //
-//        force_type fpredict(const fd_type &fdij, const aed_rctype &aedi) {
+//        force_type fpredict(const fd_type &fdij, const aed_type2 &aedi) {
 //            return kernel.fpredict(weights,fdij,aedi).array();
 //        }
 //