implemented determination of current, previous and last periods