Final version of generic code, with correct figures.

Signed-off-by: Eduardo Tenorio <embatbr@gmail.com>