more work on local mode
Cleaned up local mode a bit. Not finished, but usable.