added progress bar, input validation and total refactoring