Update Goods u function

Modified function to calculate Goods u to use more efficient table() function