Moved some initialization from main() to new functions in functions.cpp