Added three functions that will perform normalization and thinning