started working on code for lightcurves