Global analysis code added and tested on two simple test cases