Oops, sorry, copied over the development code, not the final version. This one should work properly

More...