Finished in principle, now needs debugging