removed generic var, added stack var and global var