Have new implementation, going to get rid of redundant code
Have removed now redundant functions
Tidied slightly
Updated with new formulation