Renamed variable for clarity

From now on we are going to use '$input' to refer to the user input,
instead of a more generic '$str'.
Renamed variables
Fixed tests