new clean R script for figures. everything is working fine now. wrapping it up for report before python implementation