gibbs code now includes single epoch function