first working version, not tdd tested