removed unneeded multiplications by zero by separating the first iteration from the following ones in a loop