Added normalize function