few changes to get to a testable version