fixed the generate function

now takes into account the cumulative margins of each column.
Also added suffix and prefix classes