Added While loop
Added functions for validating operaor and refactored code
Added Validation and comments