make pulsate function into a cos