network detection working. Changes in code structure too.