First sort-of working version