changed FOREACH macro and got rid of data(p) and next(p) macro