finish local mode; need more tests