Made more modular. TODO: write functions to get user values for variables.