More or less working, but too complicated