Correction Factor Algorithm

Hi guys, just stepped on xdrip and I am so far really amazed by it in connection with my Freestyle Libre and the smartwatch 3. What I wondered however is, if there aren't any possibilities of creating an algorithm that can calculate your perfect insulin correction factor in accordance to the BG data und Bolus Data accumulated? Do you guys know of any program or app that can calculate individual correction factors and even Carb/Insulin factors?

Would be awesome!