continued work on c++ implementation, using eigen for linear algebra