fixing a bug of multiplying by 0 that was not my intention