Normalization made with a single std.
Added comprobation for zero-division cases.