allocate J here for now, will try to hide this elsewhere