implemented periodic formula generator