Added Test Cases and refactored.
If not able to read input file then parse fails.