added more tests for raise to raise exception and refactored code
edited comment