Add: reset function and global variables