computation for more periods