Cleaned up old versions / implementation in c++