Added clean function to remove null space