HR1 Cost function stage 1, needs testing
Merge branch 'tabu' of https://github.com/tomecki/cats into tabu