Finished normalizeQuantity method