Refactored functions
Merge branch 'analytic' of https://github.com/shitala-cuelogic/3BLTdd into analytic