Added a feature of video overlay on graphics planes and Cleaned up usage of global variables