Commented code and added error checking to geoip