added flags, ability to read from local dir (mounted ec2 volume)