port: got through a 2000 line cpp file