-added support fir reading from file