loading kappa map, some debug and trace functions