calc. standard deviation + clear prev. variables