Replaced endl with '\n' in cout expressions
Removed redundant this->
Improved input function