Renamed a few variables for clarity and changed some messages to print
to console instead of being logged.