added methods and global vars