Added reader functionality to main()