initial somewhat working. Multiple todo's scattered around.