improved metadata script, now with OPTIONS!