added constructor for reader