moved some stuff to kappaanalysis and rearranged other stuff