adding necessary headers and global vars