fixing bugs;
custom sample period;