Altered the implementation of the Metropolis sampler. Now uses simplified behavioural functions and better caching.