broken version but works if you remove line 105,106 of Halos.py