added checks for main function, class inheritance, fixed some of the static/virutal calls bugs