Created functions for normalization phase 2