adding code for normalizing