Change HMM functions so that there are less function calls
Manually inlining function halves run time!!!