fixed bug with multiplication
a little optimized
fixed bug