JC code with repulsion and some cleaning