tweak and optimize; begin rewriting of interface