got rid of globals and added debug info to mobile page