bug fix & change/cleaning in my research code