for ($b=1; $b<$max; $b++) {