move some SG maths around
add test x64 batch
add some new tests