Improve comments
Fix wrong value return
Fix dictionary iteration
Fix integer and float division
Cosmetic: change reference to own class from its name to 'self'
More cosmetic changes
Update variable name to current data structure
Fix foreground detector logic
Fix float division
Fix invalid access to array
Fix WiFi ratio estimation
Change access to function variable to function call
Add field to indicate hardware status
Add field to indicate hardware status
Consider the case when WiFi or 3G are off