updated to handle NTO w or w/o metadata