corrected such that table updates when function is added