4 inner for loops into 1 in fwt97_pd
combined bar and foo into fwt97_pd