Fixed typo in functions, move functions around in offline engine and added accum test function