added docs and more functions for building/deconstructing formulas