Program for calculating j values and other things