Update: don't use global variables, line 16