Checking for modem and gps, and setting variables.