Small test addition and small speed ups in calculation thread