Main logic for applicaiton w/tests.