More work on TA862. Added unittests