started on #37 and misc changes