added autotesting and logging