enhanced version with multiplication

Signed-off-by: Jerome Loisel <jeromeloiselmaurin@gmail.com>