Made a start but test doen't work.
Added next step and fixed minor bugs.