#5 implemented, product function changed
#6 implemented
#10 implemented
Issue #11 implemented
#13 implemented