pencils down: main functionality finished. Tests and futher modifications to come