add comments for better documentation and add storage area for global