Faster parsing
Since matlab is so very slow, moved to a cpp file..