Fixed some errors and bad naming conventions
Changed the way the found variable works to make more sense.
Added an error print for bad hostname.
Fixed minor misallocation of memory for a variable.
Other minor changes.