first version, runnng but several TODOs in code