Added first part of algorithm to gather names for each formula component