Added Type checking. Now in case of most sementic error, program gracefully exits... :)