Bug fix

1. Changed variable name str -> input_string
2. Optimized input string logic
Bug fix

- Segregated code based on classes.