renaming module variable to avoid conflicts
fixing bugs regarding array of formulas