minor changes; add simple tests