fixed #49 added signature to directly pass a reader and filename