created a bunch of prototype functions, finished input validation in main()