seg fault fixed. now fixing weighted_gal