Updating old code to modern cpp